package com.cdhk.controller;

import com.cdhk.service.ExportPartReportService;
import com.ty.basic.constant.ApiPathConstant;
import com.ty.basic.response.ResponseResult;
import io.swagger.annotations.Api;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;

@RestController
@Api(tags = "报表")
@RequestMapping(ApiPathConstant.PRODUCT_VERSION_ONE_PATH + "report/")
public class ExportPartReportController {
    @Resource
    private ExportPartReportService exportPartReportService;

    /**
     * 产品零部件明细表
     * @param partOid
     * @return
     */
    @GetMapping("exportPartDetailReport")
    public void exportPartDetailReport(@Param("partOid") String partOid, HttpServletResponse response) {
        exportPartReportService.exportPartDetailReport(partOid,response);
    }

    /**
     * 产品外购件明细表
     */
    @GetMapping("exportOutSourcingDetailReport")
    public void exportOutSourcingDetailReport(@Param("partOid") String partOid, HttpServletResponse response) {
        exportPartReportService.exportOutSourcingDetailReport(partOid,response);
    }

    /**
     * 产品电气件明细表
     */
    @GetMapping("exportElectricalDetailReport")
    public void exportElectricalDetailReport(@Param("partOid") String partOid, HttpServletResponse response) {
        exportPartReportService.exportElectricalDetailReport(partOid,response);
    }

    /**
     * 产品工艺材料明细表
     */
    @GetMapping("exportProcessMaterialDetailReport")
    public void exportProcessMaterialDetailReport(@Param("partOid") String partOid, HttpServletResponse response) {
        exportPartReportService.exportProcessMaterialDetailReport(partOid,response);
    }
}
